tests/animated-resizing: Resize widget instead of window
authorJonas Ådahl <jadahl@gmail.com>
Wed, 2 Dec 2020 09:18:04 +0000 (10:18 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Mon, 7 Dec 2020 08:46:39 +0000 (09:46 +0100)
This means the window needs to be marked as non-resizable, otherwise it
won't shrink.

tests/animated-resizing.c

index 9b5133a88dee750838dac0260899942cc7975b7d..0446b29b68f62686d5ff332c1972e74b1263f8cc 100644 (file)
@@ -123,8 +123,8 @@ on_frame (double progress)
       window_height = HEIGHT + jitter;
     }
 
-  gtk_window_resize (GTK_WINDOW (window),
-                     window_width, window_height);
+  gtk_widget_set_size_request (gtk_window_get_child (GTK_WINDOW (window)),
+                               window_width, window_height);
 
   gtk_widget_queue_draw (window);
 }
@@ -196,6 +196,7 @@ main(int argc, char **argv)
            cb_no_resize ? "no" : "yes");
 
   window = gtk_window_new ();
+  gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
   frame_stats_ensure (GTK_WINDOW (window));
 
   da = gtk_drawing_area_new ();